package com.youpai.platform.user.web.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.youpai.platform.common.constant.BizConstant;
import com.youpai.platform.user.service.entity.po.UserPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author huanghao
 * @version 1.0
 * @description 用户ItemDTO
 * @date 2022/8/14
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "UserItemDTO",description = "用户基本信息")
public class UserItemDTO {

    @ApiModelProperty(value = "用户id")
    private String uid;

    @ApiModelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "用户accId")
    private String accId;

    @ApiModelProperty(value = "关注状态")
    private Integer followStatus;

    public UserItemDTO() {

    }

    public UserItemDTO(UserPO userPO) {
        setUid(userPO.getUid().toString());
        setUserName(userPO.getUserName());
        setNickName(userPO.getNickName());
        setAvatar(userPO.getAvatar());
        if(userPO.getChatAccountPO() != null) {
            setAccId(userPO.getChatAccountPO().getAccId());
        }
    }
}
